package reflect_test;
//反射
class Person {}; //创建一个Person类，让Student继续
public class Student extends Person {
    private String name;
    public int age;
    String sex;
    public static String country = "中国";

    public Student(){
        System.out.println("Student类的无参构造");
    }

    public static void test() {
        System.out.println("Student类的静态方法");
    }

    public void fun(String msg) {
        System.out.println(this.name + "Student类的普通方法");
        System.out.println(msg);
    }

    private Student(String name){
        this.name = name;
        System.out.println("Student类的name构造");
    }
        //包范围权限的构造方法
    Student(String name,String sex,int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        System.out.println("Student类的三个参数的构造");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }

}

